<template xmlns="custom">
  <div-head>首页</div-head>
  <div class="body">
    <swipe :images="images" :autoplay="2000"></swipe>
  </div>
</template>

<script>
import {Home}                         from "../../services/Home";
import {apiStatus}                    from "../../../config/status";

export default {
  name: "home",
  data() {
    return {
      images: [
        // '/src/assets/img/1.jpg',
        // '/src/assets/img/2.png',
      ]
    };
  },

  async created() {
    await this.init();
  },

  methods: {
    async init() {
      const result = await Home.home_init({id:1});

      if (result.status === apiStatus.success) {
        this.images = result.data;
      }
    },
  },
}
</script>

<style scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>